﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using log4net;

public partial class Shipping : System.Web.UI.Page
{
    protected string environment;

    private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

    protected void Page_Load(object sender, EventArgs e)
    {
        log4net.Config.XmlConfigurator.Configure();

        //setting the environment for Checkout script
        bool sandboxFlag = Boolean.Parse(System.Configuration.ConfigurationManager.AppSettings.Get("SANDBOX_FLAG"));

        if (sandboxFlag)
        {
            this.environment = System.Configuration.ConfigurationManager.AppSettings.Get("SANDBOX_ENV");
        }
        else
        {
            this.environment = System.Configuration.ConfigurationManager.AppSettings.Get("LIVE_ENV");
        }

        if (Session["csrf"] == null)
        {
            log.Info(
                "Session expired: force redirect back to Index."
            );

            Response.Redirect("Index.aspx");
        }
    }

}